package com.kamistoat.meimeistore.authserver.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

@Data
public class UserRegisterVo {
    /**
     * 用户名
     */
    @NotEmpty(message = "用户名必须提交")
    @Length(min=4,max=18,message = "用户名长度为4~20位")
    private String username;
    /**
     * 密码
     */
    @NotEmpty(message = "密码不能为空")
    @Length(min=6,max=28,message = "密码长度6~20位")
    private String password;
    /**
     * 手机号码
     */
    @NotEmpty(message = "手机号不能为空")
    // 1开头，第二位是3-9，后面9位必须位于0-9
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$",message = "手机号格式不正确")
    private String phoneNum;
    /**
     * 验证码
     */
    @NotEmpty(message = "验证码不能为空")
    private String code;
}
